package com.tps.service.impl;

import com.codingapi.tx.annotation.TxTransaction;
import com.tps.dao.GoodsDao;
import com.tps.entity.Goods;
import com.tps.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author charlee.wu
 * @date 2018-5-7 14:56:55
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsDao goodsDao;

    @Override
    @Transactional
    @TxTransaction
    public void save() {
        Goods goods = new Goods();
        goods.setName("xxx");
        goods.setNumber(0);
        goodsDao.saveAndFlush(goods);
    }
}
